import { useParams, useSearchParams } from "react-router-dom";
//searchParams传参
// const User = () => {
//   const [params] = useSearchParams();
//   const id = params.get("id");
//   const name = params.get("name");
//   return (
//     <div>
//       User--{id}--{name}
//     </div>
//   );
// };

// params传参
const User = () => {
  const params = useParams();
  const id = params.id;
  const name = params.name;
  return (
    <div>
      User--{id}--{name}
    </div>
  );
};

export default User;
